/**
 * @单位名称：飞羽个人
 * 	Copyright (c) 2017 All Rights Reserved.
 * @系统名称：测试
 * @工程名称：
 * @文件名称: 
 * @类路径: 
 */
package com.feiyu.service.impl;

import com.feiyu.bean.HouseProjectChange;
import com.feiyu.common.util.CustomExcelUtil;
import com.feiyu.dao.HouseProjectChangeMapper;
import com.feiyu.dao.HouseProjectMapper;
import com.feiyu.service.HouseProjectChangeService;
import com.feiyu.common.service.impl.BaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.io.File;
import java.util.List;

/**
 * 
 * 
 * @see
 * @author 	nanshouxiao
 * @date	2018-5-23 17:36:42
 * @version	V1.0.0
 */
@Service("houseProjectChangeServiceImpl")
public class HouseProjectChangeServiceImpl extends BaseServiceImpl<HouseProjectChange, Integer> implements HouseProjectChangeService
{
    @Autowired
    private HouseProjectChangeMapper houseProjectChangeMapper;

    @Override
    public void importProjectChangeByFilepath(String filePath, String batchNumber) {
        File file = new File(filePath);
        List<HouseProjectChange> houseProjectChangeList = CustomExcelUtil.handleProjectChangeExcel(file);
        houseProjectChangeList.forEach(houseProjectChange -> houseProjectChange.setBatchNumber(batchNumber));
        houseProjectChangeMapper.batchSaveEntity(houseProjectChangeList);
    }
}